<template>
  <div class="footer">
    <p>
      Copyright <a href="https:www.blogszn.cn">宁博客</a> 晋ICP备2022010783号-1
    </p>

    <p id="span"></p>
  </div>
</template>
<script>
import { formatDate } from "../util/tool";
export default {
  name: "tag",
  data() {
    return {};
  },
  watch: {},

  mounted() {
    function runtime() {
      let X = new Date("01/15/2023 0:0:00");
      let Y = new Date();

      let T = Y.getTime() - X.getTime();

      let M = 24 * 60 * 60 * 1000;

      let a = T / M;
      // console.log(a);
      let A = Math.floor(a);

      let b = (a - A) * 24;
      // console.log(b);
      let B = Math.floor(b);

      let c = (b - B) * 60;
      // console.log(c);
      let C = Math.floor((b - B) * 60);

      let D = Math.floor((c - C) * 60);
      if (document.getElementById("span") != null) {
        document.getElementById("span").innerText =
          "本站良好运行: " + A + "天" + B + "小时" + C + "分" + D + "秒";
      }
    }

    setInterval(runtime, 1000);
  },
  methods: {},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.footer {
  overflow: hidden;
  width: 100%;
  height: 65px;
  text-align: center;
  // line-height: 65px;
  color: #fff;
  //   background-image: linear-gradient(left, right, #333 red);
  background-color: #333;
  p {
    font-size: 12px;
    margin-top: 5px;
  }
  & p:nth-child(1) {
    margin-top: 10px;
  }
  & p:nth-child(2) {
    color: rgb(120, 104, 104);
  }
  a {
    color: #fff;
  }
}
</style>
